<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Extensions to gdk-pixbuf: exo Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="exo Reference Manual">
<link rel="up" href="exo-extensions.html" title="Part V. Extensions to existing frameworks">
<link rel="prev" href="exo-extensions.html" title="Part V. Extensions to existing frameworks">
<link rel="next" href="exo-Extensions-to-GObject.html" title="Extensions to GObject">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#exo-Extensions-to-gdk-pixbuf.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="exo-extensions.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="exo-extensions.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="exo-Extensions-to-GObject.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="exo-Extensions-to-gdk-pixbuf"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="exo-Extensions-to-gdk-pixbuf.top_of_page"></a>Extensions to gdk-pixbuf</span></h2>
<p>Extensions to gdk-pixbuf — Miscelleanous extensions to the gdk-pixbuf library</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="exo-Extensions-to-gdk-pixbuf.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="function_type">
<span class="returnvalue">GdkPixbuf</span> *
</td>
<td class="function_name">
<a class="link" href="exo-Extensions-to-gdk-pixbuf.html#exo-gdk-pixbuf-colorize" title="exo_gdk_pixbuf_colorize ()">exo_gdk_pixbuf_colorize</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkPixbuf</span> *
</td>
<td class="function_name">
<a class="link" href="exo-Extensions-to-gdk-pixbuf.html#exo-gdk-pixbuf-frame" title="exo_gdk_pixbuf_frame ()">exo_gdk_pixbuf_frame</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkPixbuf</span> *
</td>
<td class="function_name">
<a class="link" href="exo-Extensions-to-gdk-pixbuf.html#exo-gdk-pixbuf-lucent" title="exo_gdk_pixbuf_lucent ()">exo_gdk_pixbuf_lucent</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkPixbuf</span> *
</td>
<td class="function_name">
<a class="link" href="exo-Extensions-to-gdk-pixbuf.html#exo-gdk-pixbuf-spotlight" title="exo_gdk_pixbuf_spotlight ()">exo_gdk_pixbuf_spotlight</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkPixbuf</span> *
</td>
<td class="function_name">
<a class="link" href="exo-Extensions-to-gdk-pixbuf.html#exo-gdk-pixbuf-scale-down" title="exo_gdk_pixbuf_scale_down ()">exo_gdk_pixbuf_scale_down</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkPixbuf</span> *
</td>
<td class="function_name">
<a class="link" href="exo-Extensions-to-gdk-pixbuf.html#exo-gdk-pixbuf-scale-ratio" title="exo_gdk_pixbuf_scale_ratio ()">exo_gdk_pixbuf_scale_ratio</a> <span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="function_type">
<span class="returnvalue">GdkPixbuf</span> *
</td>
<td class="function_name">
<a class="link" href="exo-Extensions-to-gdk-pixbuf.html#exo-gdk-pixbuf-new-from-file-at-max-size" title="exo_gdk_pixbuf_new_from_file_at_max_size ()">exo_gdk_pixbuf_new_from_file_at_max_size</a> <span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="exo-Extensions-to-gdk-pixbuf.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;exo/exo.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="exo-Extensions-to-gdk-pixbuf.description"></a><h2>Description</h2>
<p>This facility includes several functions to extend the basic functionality
provided by the gdk-pixbuf library.</p>
</div>
<div class="refsect1">
<a name="exo-Extensions-to-gdk-pixbuf.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="exo-gdk-pixbuf-colorize"></a><h3>exo_gdk_pixbuf_colorize ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkPixbuf</span> *
exo_gdk_pixbuf_colorize (<em class="parameter"><code>const <span class="type">GdkPixbuf</span> *source</code></em>,
                         <em class="parameter"><code>const <span class="type">GdkColor</span> *color</code></em>);</pre>
<p>Creates a new <span class="type">GdkPixbuf</span> based on <em class="parameter"><code>source</code></em>
, which is
colorized to <em class="parameter"><code>color</code></em>
.</p>
<p>The caller is responsible to free the returned object
using <code class="function">g_object_unref()</code> when no longer needed.</p>
<div class="refsect3">
<a name="exo-gdk-pixbuf-colorize.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>source</p></td>
<td class="parameter_description"><p>the source <span class="type">GdkPixbuf</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>color</p></td>
<td class="parameter_description"><p>the new color.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="exo-gdk-pixbuf-colorize.returns"></a><h4>Returns</h4>
<p> the colorized <span class="type">GdkPixbuf</span>.</p>
</div>
<p class="since">Since: <a class="link" href="ch01.html#api-index-0.3.1.3" title="Added in 0.3.1.3">0.3.1.3</a></p>
</div>
<hr>
<div class="refsect2">
<a name="exo-gdk-pixbuf-frame"></a><h3>exo_gdk_pixbuf_frame ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkPixbuf</span> *
exo_gdk_pixbuf_frame (<em class="parameter"><code>const <span class="type">GdkPixbuf</span> *source</code></em>,
                      <em class="parameter"><code>const <span class="type">GdkPixbuf</span> *frame</code></em>,
                      <em class="parameter"><code><span class="type">gint</span> left_offset</code></em>,
                      <em class="parameter"><code><span class="type">gint</span> top_offset</code></em>,
                      <em class="parameter"><code><span class="type">gint</span> right_offset</code></em>,
                      <em class="parameter"><code><span class="type">gint</span> bottom_offset</code></em>);</pre>
<p>Embeds <em class="parameter"><code>source</code></em>
 in <em class="parameter"><code>frame</code></em>
 and returns the result as new <span class="type">GdkPixbuf</span>.</p>
<p>The caller is responsible to free the returned <span class="type">GdkPixbuf</span> using <code class="function">g_object_unref()</code>.</p>
<div class="refsect3">
<a name="exo-gdk-pixbuf-frame.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>source</p></td>
<td class="parameter_description"><p>the source <span class="type">GdkPixbuf</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>frame</p></td>
<td class="parameter_description"><p>the frame <span class="type">GdkPixbuf</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>left_offset</p></td>
<td class="parameter_description"><p>the left frame offset.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>top_offset</p></td>
<td class="parameter_description"><p>the top frame offset.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>right_offset</p></td>
<td class="parameter_description"><p>the right frame offset.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>bottom_offset</p></td>
<td class="parameter_description"><p>the bottom frame offset.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="exo-gdk-pixbuf-frame.returns"></a><h4>Returns</h4>
<p> the framed version of <em class="parameter"><code>source</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="ch01.html#api-index-0.3.1.9" title="Added in 0.3.1.9">0.3.1.9</a></p>
</div>
<hr>
<div class="refsect2">
<a name="exo-gdk-pixbuf-lucent"></a><h3>exo_gdk_pixbuf_lucent ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkPixbuf</span> *
exo_gdk_pixbuf_lucent (<em class="parameter"><code>const <span class="type">GdkPixbuf</span> *source</code></em>,
                       <em class="parameter"><code><span class="type">guint</span> percent</code></em>);</pre>
<p>Returns a version of <em class="parameter"><code>source</code></em>
, whose pixels translucency is
<em class="parameter"><code>percent</code></em>
 of the original <em class="parameter"><code>source</code></em>
 pixels.</p>
<p>The caller is responsible to free the returned object
using <code class="function">g_object_unref()</code> when no longer needed.</p>
<div class="refsect3">
<a name="exo-gdk-pixbuf-lucent.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>source</p></td>
<td class="parameter_description"><p>the source <span class="type">GdkPixbuf</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>percent</p></td>
<td class="parameter_description"><p>the percentage of translucency.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="exo-gdk-pixbuf-lucent.returns"></a><h4>Returns</h4>
<p> a translucent version of <em class="parameter"><code>source</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="ch01.html#api-index-0.3.1.3" title="Added in 0.3.1.3">0.3.1.3</a></p>
</div>
<hr>
<div class="refsect2">
<a name="exo-gdk-pixbuf-spotlight"></a><h3>exo_gdk_pixbuf_spotlight ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkPixbuf</span> *
exo_gdk_pixbuf_spotlight (<em class="parameter"><code>const <span class="type">GdkPixbuf</span> *source</code></em>);</pre>
<p>Creates a lightened version of <em class="parameter"><code>source</code></em>
, suitable for
prelit state display of icons.</p>
<p>The caller is responsible to free the returned
pixbuf using <code class="function"><GTKDOCLINK HREF="g-object-unref"><code class="function">g_object_unref()</code></code></GTKDOCLINK>.</p>
<div class="refsect3">
<a name="exo-gdk-pixbuf-spotlight.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>source</p></td>
<td class="parameter_description"><p>the source <span class="type">GdkPixbuf</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<div class="refsect3">
<a name="exo-gdk-pixbuf-spotlight.returns"></a><h4>Returns</h4>
<p> the lightened version of <em class="parameter"><code>source</code></em>
.</p>
</div>
<p class="since">Since: <a class="link" href="ch01.html#api-index-0.3.1.3" title="Added in 0.3.1.3">0.3.1.3</a></p>
</div>
<hr>
<div class="refsect2">
<a name="exo-gdk-pixbuf-scale-down"></a><h3>exo_gdk_pixbuf_scale_down ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkPixbuf</span> *
exo_gdk_pixbuf_scale_down (<em class="parameter"><code><span class="type">GdkPixbuf</span> *source</code></em>,
                           <em class="parameter"><code><span class="type">gboolean</span> preserve_aspect_ratio</code></em>,
                           <em class="parameter"><code><span class="type">gint</span> dest_width</code></em>,
                           <em class="parameter"><code><span class="type">gint</span> dest_height</code></em>);</pre>
<p>Scales down the <em class="parameter"><code>source</code></em>
 to fit into the given <em class="parameter"><code>width</code></em>
 and
<em class="parameter"><code>height</code></em>
. If <em class="parameter"><code>aspect_ratio</code></em>
 is <code class="literal">TRUE</code> then the aspect ratio
of <em class="parameter"><code>source</code></em>
 will be preserved.</p>
<p>If <em class="parameter"><code>width</code></em>
 is larger than the width of <em class="parameter"><code>source</code></em>
 and <em class="parameter"><code>height</code></em>

is larger than the height of <em class="parameter"><code>source</code></em>
, a reference to
<em class="parameter"><code>source</code></em>
 will be returned, as it's unneccesary then to
scale down.</p>
<p>The caller is responsible to free the returned <span class="type">GdkPixbuf</span>
using <code class="function">g_object_unref()</code> when no longer needed.</p>
<div class="refsect3">
<a name="exo-gdk-pixbuf-scale-down.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>source</p></td>
<td class="parameter_description"><p>the source <span class="type">GdkPixbuf</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>preserve_aspect_ratio</p></td>
<td class="parameter_description"><p><code class="literal">TRUE</code> to preserve aspect ratio.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest_width</p></td>
<td class="parameter_description"><p>the max width for the result.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest_height</p></td>
<td class="parameter_description"><p>the max height for the result.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="exo-gdk-pixbuf-scale-down.returns"></a><h4>Returns</h4>
<p> the resulting <span class="type">GdkPixbuf</span>.</p>
</div>
<p class="since">Since: <a class="link" href="ch01.html#api-index-0.3.1.1" title="Added in 0.3.1.1">0.3.1.1</a></p>
</div>
<hr>
<div class="refsect2">
<a name="exo-gdk-pixbuf-scale-ratio"></a><h3>exo_gdk_pixbuf_scale_ratio ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkPixbuf</span> *
exo_gdk_pixbuf_scale_ratio (<em class="parameter"><code><span class="type">GdkPixbuf</span> *source</code></em>,
                            <em class="parameter"><code><span class="type">gint</span> dest_size</code></em>);</pre>
<p>Scales <em class="parameter"><code>source</code></em>
 to <em class="parameter"><code>dest_size</code></em>
 while preserving the aspect ratio of
<em class="parameter"><code>source</code></em>
.</p>
<div class="refsect3">
<a name="exo-gdk-pixbuf-scale-ratio.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>source</p></td>
<td class="parameter_description"><p>The source <span class="type">GdkPixbuf</span>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>dest_size</p></td>
<td class="parameter_description"><p>The target size in pixel.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="exo-gdk-pixbuf-scale-ratio.returns"></a><h4>Returns</h4>
<p> A newly created <span class="type">GdkPixbuf</span>.</p>
</div>
</div>
<hr>
<div class="refsect2">
<a name="exo-gdk-pixbuf-new-from-file-at-max-size"></a><h3>exo_gdk_pixbuf_new_from_file_at_max_size ()</h3>
<pre class="programlisting"><span class="returnvalue">GdkPixbuf</span> *
exo_gdk_pixbuf_new_from_file_at_max_size
                               (<em class="parameter"><code>const <span class="type">gchar</span> *filename</code></em>,
                                <em class="parameter"><code><span class="type">gint</span> max_width</code></em>,
                                <em class="parameter"><code><span class="type">gint</span> max_height</code></em>,
                                <em class="parameter"><code><span class="type">gboolean</span> preserve_aspect_ratio</code></em>,
                                <em class="parameter"><code><span class="type">GError</span> **error</code></em>);</pre>
<p>Creates a new <span class="type">GdkPixbuf</span> by loading an image from the file at
<em class="parameter"><code>filename</code></em>
. The file format is detected automatically. If <code class="literal">NULL</code> is
returned, then <em class="parameter"><code>error</code></em>
 will be set. Possible errors are in the
<span class="type">GDK_PIXBUF_ERROR</span> and <span class="type">G_FILE_ERROR</span> domains. If the image dimensions
exceed <em class="parameter"><code>max_width</code></em>
 or <em class="parameter"><code>max_height</code></em>
, the image will be scaled down to
fit into the dimensions, optionally preservingthe image's aspect
ratio. The image may still be larger, depending on the loader.</p>
<p>The advantage of using this function over
<code class="function">gdk_pixbuf_new_from_file_at_scale()</code> is that images will never be
scaled up, whichwould otherwise result in ugly images.</p>
<div class="refsect3">
<a name="exo-gdk-pixbuf-new-from-file-at-max-size.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>filename</p></td>
<td class="parameter_description"><p>name of the file to load, in the GLib file
name encoding.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>max_width</p></td>
<td class="parameter_description"><p>the maximum width of the loaded image.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>max_height</p></td>
<td class="parameter_description"><p>the maximum height of the loaded image.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>preserve_aspect_ratio</p></td>
<td class="parameter_description"><p><code class="literal">TRUE</code> to preserve the image's aspect ratio
while scaling to fit into <em class="parameter"><code>max_width</code></em>
and <em class="parameter"><code>max_height</code></em>
.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>error</p></td>
<td class="parameter_description"><p>return location for errors or <code class="literal">NULL</code>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect3">
<a name="exo-gdk-pixbuf-new-from-file-at-max-size.returns"></a><h4>Returns</h4>
<p> a newly created <span class="type">GdkPixbuf</span> with a reference count or 1, or
<code class="literal">NULL</code> if any of several error conditions occurred: the file
could not be opened, there was no loader for the file's format,
there was not enough memory to allocate the buffer for the
image, or the image file contained invalid data.</p>
</div>
<p class="since">Since: <a class="link" href="ch01.html#api-index-0.3.1.9" title="Added in 0.3.1.9">0.3.1.9</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>